<template>
  <el-dialog :modal-append-to-body="true" :append-to-body="true" :close-on-click-modal="false" title="提示"
    :visible.sync="visible" @close="$emit('update:show', false)" :show="show" width="30%">
    <p class="tips1">{{message}}</p>
    <span slot="footer" class="dialog-footer">
      <el-button size="mini" type="primary" @click="addtag">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapState, mapMutations } = createNamespacedHelpers("charts");
export default {
  name: "confirmDialog",
  props: {
    show: {
      type: Boolean,
      default: false
    },
    msg: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      visible: this.show,
      message: this.msg
    };
  },
  methods: {
    addtag() {
      this.$emit("update:show", false);
      this.setshadeDisplay(true);
    },
    ...mapMutations(["setshadeDisplay"])
  },
  watch: {
    show(val) {
      this.visible = this.show;
    }
  }
};
</script>

<style scoped>
.tips1 {
  font-size: 14px;
  text-align: center;
}
</style>
